<?php
header('content-type:text/html;charset=utf-8');

//echo '<table border="1" width="50%" cellpadding="0" cellspacing="0">';
if (isset($_GET['areaid'])) {
    //板块界面
    $search_area_asc = sql_area($_GET['areaid']);
    echo '<h4><a href="forum.php?areaid=' . $search_area_asc['area_id'] . '">' . $search_area_asc['area_title'] . '</a></h4>';
    echo '----------------------------';
    $result = sql_areaid_forum($search_area_asc['area_id']);
    while (($forum_array = mysqli_fetch_array($result)) != false) {
        echo '<h6><a href="forums.php?forumid=' . $forum_array['forum_id'] . '&p=1">' . $forum_array['forum_name'] . '</a> (共：<u>'.$forum_array['form_topics'].'</u>隐藏：<u>'.sql_count_hidden_forumid_topics($forum_array['forum_id']).'</u>待审核：<u>'.sql_count_waitten_forumid_topics($forum_array['forum_id']).'</u>)</h6>';
    }
    echo '<hr>';
} else {
    //论坛区界面
    $search_area_asc = search_bbs_area_asc();
    while (($area_array = mysqli_fetch_array($search_area_asc)) != false) {
        echo '<h4><a href="forum.php?areaid=' . $area_array['area_id'] . '">' . $area_array['area_title'] . '</a></h4>';
        echo '----------------------------';
        $result = sql_areaid_forum($area_array['area_id']);
        while (($forum_array = mysqli_fetch_array($result)) != false) {
            echo '<h6><a href="forums.php?forumid=' . $forum_array['forum_id'] . '&p=1">' . $forum_array['forum_name'] . '</a> (共：<u>'.sql_count_forumid_topic($forum_array['forum_id']).'</u>隐藏：<u>'.sql_count_hidden_forumid_topics($forum_array['forum_id']).'</u>待审核：<u>'.sql_count_waitten_forumid_topics($forum_array['forum_id']).'</u>)</h6>';
        }
        echo '<hr>';
    }
}
//echo '</table>';

?>